package com.wilmer.children.service.impl;

import java.util.List;
import com.wilmer.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wilmer.children.mapper.YwGrowthArchiveMapper;
import com.wilmer.children.domain.YwGrowthArchive;
import com.wilmer.children.service.IYwGrowthArchiveService;

/**
 * archiveService业务层处理
 * 
 * @author hans
 * @date 2024-05-19
 */
@Service
public class YwGrowthArchiveServiceImpl implements IYwGrowthArchiveService 
{
    @Autowired
    private YwGrowthArchiveMapper ywGrowthArchiveMapper;

    /**
     * 查询archive
     * 
     * @param archiveId archive主键
     * @return archive
     */
    @Override
    public YwGrowthArchive selectYwGrowthArchiveByArchiveId(Long archiveId)
    {
        return ywGrowthArchiveMapper.selectYwGrowthArchiveByArchiveId(archiveId);
    }

    /**
     * 查询archive列表
     * 
     * @param ywGrowthArchive archive
     * @return archive
     */
    @Override
    public List<YwGrowthArchive> selectYwGrowthArchiveList(YwGrowthArchive ywGrowthArchive)
    {
        return ywGrowthArchiveMapper.selectYwGrowthArchiveList(ywGrowthArchive);
    }

    /**
     * 新增archive
     * 
     * @param ywGrowthArchive archive
     * @return 结果
     */
    @Override
    public int insertYwGrowthArchive(YwGrowthArchive ywGrowthArchive)
    {
        ywGrowthArchive.setCreateTime(DateUtils.getNowDate());
        return ywGrowthArchiveMapper.insertYwGrowthArchive(ywGrowthArchive);
    }

    /**
     * 修改archive
     * 
     * @param ywGrowthArchive archive
     * @return 结果
     */
    @Override
    public int updateYwGrowthArchive(YwGrowthArchive ywGrowthArchive)
    {
        ywGrowthArchive.setUpdateTime(DateUtils.getNowDate());
        return ywGrowthArchiveMapper.updateYwGrowthArchive(ywGrowthArchive);
    }

    /**
     * 批量删除archive
     * 
     * @param archiveIds 需要删除的archive主键
     * @return 结果
     */
    @Override
    public int deleteYwGrowthArchiveByArchiveIds(Long[] archiveIds)
    {
        return ywGrowthArchiveMapper.deleteYwGrowthArchiveByArchiveIds(archiveIds);
    }

    /**
     * 删除archive信息
     * 
     * @param archiveId archive主键
     * @return 结果
     */
    @Override
    public int deleteYwGrowthArchiveByArchiveId(Long archiveId)
    {
        return ywGrowthArchiveMapper.deleteYwGrowthArchiveByArchiveId(archiveId);
    }
}
